<template>
	<view class="pages">
		<u-cell-group :clickable="true" :border="false"
			:customStyle="{backgroundColor:'#fff',borderRadius:'20rpx',padding:'10rpx'}">
			<!-- <u-cell title="个人资料" isLink url='/pages/my/setting/baseInfo'></u-cell> -->
			<u-cell title="关于大宾租房" isLink  :border="false" url="/pages/my/setting/concerning"></u-cell>
		</u-cell-group>
		<u-cell-group :clickable="true" :border="false"
			:customStyle="{marginTop:'30rpx',backgroundColor:'#fff',borderRadius:'20rpx',padding:'10rpx'}">
			<u-cell title="退出登录" isLink url="#" :border="false" @click="showPopupQuit = true"></u-cell>
		</u-cell-group>
		<!-- 退出账号 -->
		<u-popup :show="showPopupQuit" mode="center" :round="10">
			<view class="popup">
				<view class="cue">
					确定退出账号吗？
				</view>
				<view class="button_box">
					<u-button class="sure" @click="logoutOpenQuit" color="#3c9cff">确定</u-button>
					<u-button @click="showPopupQuit = false">取消</u-button>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		quitLogin
	} from '@/api/my/index.js'
	export default {
		data() {
			return {
				showPopupQuit: false, //退出
			}
		},
		methods: {
			//退出登录
			async logoutOpenQuit() {
				const res = await quitLogin()
				if (res.data.code !== 200) return this.$refs.uToast.show({
					message: res.data.msg,
					type: 'error'
				})
				this.showPopupQuit = false
				uni.reLaunch({
					url: '/pages/landlord/login',
					animationType: this.animation.type,
					animationDuration: this.animation.time
				})
			},
		}
	}
</script>

<style lang="scss">
	@import "~@/styles/index.scss";
	@import "~@/styles/global.scss";

	.pages {
		background-color: $pagebgc;
		height: 100vh;
		padding: 30rpx;

		.popup {
			padding: 10rpx;

			.cue {
				font-weight: bold;
				font-size: 40rpx;
				text-align: left;
				padding: 40rpx;
			}

			.button_box {
				@include flexBetween;

				.sure {
					margin-right: 10rpx;
				}
			}

			.button {
				margin-bottom: 20rpx;
			}
		}
	}
</style>